# Maintainer: Caleb Maclennan< caleb@alerque.com>
# Contributor: Anton Leontiev <scileont@gmail.com>

_cpan=Shell-Command
pkgname=perl-${_cpan,,}
pkgver=0.06
pkgrel=4
pkgdesc='Perl module providing cross-platform functions emulating common shell commands'
arch=(any)
url="https://metacpan.org/release/$_cpan"
license=(GPL PerlArtistic)
depends=(perl)
options=(!emptydirs)
_archive="$_cpan-$pkgver"
source=("https://cpan.perl.org/modules/by-module/${_cpan%-*}/$_archive.tar.gz")
sha256sums=('f3e4deef577944be46fa7af5ac118ac2828911788b01bc76a74495355616ecd1')

build() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
	perl Makefile.PL
	make
}

check() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1
	make test
}

package() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
